 #!/bin/bash

rm -f testAactoAmrwb

###export FFMPEG_ROOT=/opt/ffmpeg
export FFMPEG_ROOT=/opt/ffmpeg/ffmpeg-4.2.2
###export CGO_LDFLAGS="-static -L$FFMPEG_ROOT/lib/ -lavcodec -lavformat -lavutil -lswscale -lswresample -lavdevice -lavfilter -lz -lm -lpthread -lva -lX11  -lva-drm"
##export CGO_LDFLAGS="-Wl,-Bstatic -L$FFMPEG_ROOT/lib/ -lavcodec -lavformat -lavutil -lswresample -lavdevice -lavfilter  -L/usr/lib64/  -lX11  -lva-drm -ldrm -lva -Wl,-Bdynamic -lpthread -ldl"
###export CGO_LDFLAGS="-static -L$FFMPEG_ROOT/lib/ -lavcodec -lavformat -lavutil -lswscale -lswresample -lavdevice -lavfilter "
export CGO_LDFLAGS="-static -L$FFMPEG_ROOT/lib/ -lavcodec -lavformat -lavutil -lswresample -lavdevice -lavfilter -L/usr/lib64/ -lva-x11 -lva-drm -ldrm -lva -Wl,-Bdynamic -lpthread  -ldl -lbz2 -L/usr/local/lib -lopencore-amrnb -l    opencore-amrwb -lvo-amrwbenc -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 -Wl,--as-needed"

export CGO_CFLAGS="-I$FFMPEG_ROOT/include"
export LD_LIBRARY_PATH=$FFMPEG_ROOT/lib:/usr/lib64
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export GO111MODULE=on
export GOPROXY=https://goproxy.cn,direct


go build -o testAactoAmrwb ./testAactoAmrwb.go

